/*
 this is demo.
*/

import { Action, Module, YubiModule } from './base';

export interface IAppState {
  appName: string;
}


@YubiModule({ name: 'app' })
class AppModule implements Module<IAppState>{
  public state: IAppState = {
    appName: 'Cat',
  };

  // 改到 @YubiModule 里
  // public state = reactive<IAppState>({
  //   appName: 'Cat'
  // })

  /**
   * set appName
   * @param appName app name
   */
  @Action({ log: 'set AppName' })
  setAppName(appName: string) {
    this.state.appName = appName;
  }
  @Action()
  async getUser() {
    
    await setTimeout(()=>{});
  }
}


export const appModule = new AppModule();
